import { Component, OnInit, NgZone } from '@angular/core';
import { DragDropService } from 'src/app/shared/drag-drop.service';

@Component({
  selector: 'jk-my-modal',
  templateUrl: './my-modal.component.html',
  styleUrls: ['./my-modal.component.scss']
})
export class MyModalComponent implements OnInit {

  constructor(private initDrag: DragDropService, private ngZone: NgZone) { }

  ngOnInit() {
    this.initDragDrop();
  }

  initDragDrop() {
    const ele = document.querySelector('.ant-modal-content');
    this.ngZone.runOutsideAngular(() => {
      this.initDrag.startDragDrop(ele);
    });
  }
}
